﻿import os

env = DefaultEnvironment().Clone()

BIN_DIR = os.environ['BIN_DIR']
COMMON_DIR=os.path.join(os.getcwd(), '../../common')
HMI_ROOT_DIR=os.path.join(os.getcwd(), '../../..')

sources = Glob('*.c') + Glob(os.path.join(COMMON_DIR, "*.c")) + \
    Glob(os.path.join(COMMON_DIR, "*/*.c")) + \
    Glob(os.path.join(COMMON_DIR, "*/*/*.c")) + \
    Glob(os.path.join(HMI_ROOT_DIR, "awtk-modbus/src/*.c")) + \
    Glob(os.path.join(HMI_ROOT_DIR, "awtk-sqlite3/src/*.c")) + \
    Glob(os.path.join(HMI_ROOT_DIR, "awtk-database-repository/src/*.c")) + \
    Glob(os.path.join(HMI_ROOT_DIR, "awtk-database-repository/src/*/*.c")) + \
    Glob(os.path.join(HMI_ROOT_DIR, "awtk-widget-slidable-row/src/*.c")) + \
    Glob(os.path.join(HMI_ROOT_DIR, "awtk-widget-slidable-row/src/*/*.c")) + \
    Glob(os.path.join(HMI_ROOT_DIR, "awtk-widget-table-view/src/*.c")) + \
    Glob(os.path.join(HMI_ROOT_DIR, "awtk-widget-table-view/src/*/*.c")) + \
    Glob(os.path.join(HMI_ROOT_DIR, "awtk-widget-slider-circle/src/*.c")) + \
    Glob(os.path.join(HMI_ROOT_DIR, "awtk-widget-slider-circle/src/*/*.c")) + \
    Glob(os.path.join(HMI_ROOT_DIR, "awtk-widget-table-view-mvvm/src/*.c"))

env.Program(os.path.join(BIN_DIR, 'demo'), sources)
